import shutil
import os
import send2trash

rootPath = os.getcwd()
oldPath = '../chp8_file/test1/'
newPath = rootPath + '\\backup\\'
newPath2 = rootPath + '\\backup2\\'

# print("==================复制文件和文件夹=======================")
# path = shutil.copytree(oldPath, newPath)  # 备份目录
# path = shutil.copy('../chp8_file/chp8_base.py', newPath + 'chp8_base.txt')  # 备份文件


# print("==================文件和文件夹的移动与改名=======================")
# path = shutil.move(newPath +'chp8_base.txt', newPath + 'chp8_base.py')
# path = shutil.move(newPath, newPath2)

# print("==================永久删除文件和文件夹=======================")
# os.unlink(newPath2 + 'chp8_base.py')  # 删除文件
# os.mkdir(newPath)
# os.rmdir(newPath)  # 删除空文件夹
# shutil.rmtree(newPath2)  # 删除非空文件夹

# print("==================用 send2trash 模块删除到回收站=======================")
# send2trash.send2trash(newPath + 'Provinces.py')
# send2trash.send2trash(newPath)

